package models

import (
	"gintest/database"
)
//表结构
type ArticleContent struct {
	ArticleId  int `json:"article_id" gorm:"column:article_id" form:"article_id"`
	Content string `json:"content" gorm:"column:content" form:"content"`
}
func (ArticleContent) TableName() string {
	return "article_content"
}
func AddArticleContent(data *ArticleContent) error{
	return database.SqlDB.Model(ArticleContent{}).Create(data).Error
}
func EditArticleContentById(id int,data map[string]interface{}) error{
	return database.SqlDB.Model(&ArticleContent{}).Where("article_id=?",id).Updates(data).Error
}